/*****************************************************
** Author: 
** Date: 2017-06-21
** Copyright(c) All Rights Reserved.
*****************************************************/

#ifndef __DNA_I2S_H_
#define __DNA_I2S_H_

#ifdef __cplusplus
extern "C"{
#endif

/***** INCLUDES *************************************/

/***** TYPEDEFS *************************************/

/***** DEFINES **************************************/
enum
{
    DNA_I2S_STATUS_OK = 0,
    DNA_I2S_ERR_COMM,
    DNA_I2S_ERR_PARA,
    DNA_I2S_ERR_HAL_INIT,
    DNA_I2S_ERR_HAL_CFG,
    DNA_I2S_ERR_HAL_FIFO,
    DNA_I2S_ERR_HAL_CALLBACK,
};

enum
{
    DNA_I2S_RATE_8K,
    DNA_I2S_RATE_16K,
    DNA_I2S_RATE_MAX
};

enum
{
    DNA_I2S_CHANNEL_MONO,
    DNA_I2S_CHANNEL_STEREO,
    DNA_I2S_CHANNEL_MAX
};

/***** EXTERNAL VARIABLES ***************************/

/***** EXTERNAL FUNCTIONS ***************************/

/***** VARIABLES ************************************/

/***** PROTOTYPES ***********************************/

/***** CONSTANTS ************************************/
int dna_i2s_open(unsigned int device, unsigned int format, unsigned int rate, unsigned int chan);
void dna_i2s_close(void);
void dna_i2s_tx_enable();
void dna_i2s_tx_disable();
void dna_i2s_rx_enable();
void dna_i2s_rx_disable();
void dna_i2s_tx_rx_enable();
void dna_i2s_tx_rx_disable();
int dna_i2s_tx_register(int (*func)(int, unsigned char *, unsigned int));
int dna_i2s_tx_deregister(void);
int dna_i2s_rx_register(int (*func)(int, unsigned char *, unsigned int));
int dna_i2s_rx_deregister(void);


#ifdef __cplusplus
}
#endif

#endif /* __DNA_I2S_H_ */

